public class test {
    public static double avg(int[] arr,int n){
        int num = 0;
        for (int i = 0; i < n; i++) {
            num += arr[i];
        }
        return (double)num / (double) n;
    }
    public static void main(String[] args) {
        int[] arr1= {1,2,4,5,6,7,3,43,5,6};
        double avg = avg(arr1,arr1.length);
        System.out.println("arr数组的平均数是：" + avg);
    }
}
